<?php
function getSkypeStatus($username) {
	/*
	returns:
	0 - unknown
	1 - offline
	2 - online
	3 - away
	4 - not available
	5 - do not disturb
	6 - invisible
	7 - skype me
	*/
	$remote_status = fopen ('http://mystatus.skype.com/'.$username.'.num', 'r');
	if (!$remote_status) {
	    return '0';
	    exit;
	}
	while (!feof ($remote_status)) {
	    $value = fgets ($remote_status, 1024);
	    return trim($value);
	}
	fclose($remote_status);
}

function getSkypeStatusIcon($username) {
	$status = getSkypeStatus($username);
        echo $status; die;
	// change the path of the icons folder to match your site
        if($status == 2 || $status == 7)
            echo '<img src="images/skype-online.png" alt="call '.$username.'" />';
        else
            echo '<img src="images/skype-offline.png" alt="call '.$username.'" />';
}

// retrieves the numeric status code
//getSkypeStatus('nicolovolpato');

// displays the status icon, change to match your Skype username
getSkypeStatusIcon('nicolovolpato');
?>